<ui:composition template="/WEB-INF/templates/login-template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

	<ui:define name="sidebar">
		<ui:include src="/WEB-INF/templates/public-sidebar.xhtml" />
	</ui:define>
	<ui:define name="content">
		<h:form>
			<p:growl />

			<h:panelGrid columns="8" style="width: 100%; margin-top: 5px; border-bottom: 1px solid #d9d9d9;" rendered="#{not registerAdminBean.REGISTERED}">
				<h:outputLabel value="Register WAM Administrator" styleClass="outputTextTitle"  />
			</h:panelGrid>
			<h:panelGrid columns="8" style="width: 100%;" rendered="#{not registerAdminBean.REGISTERED}">
				<h:outputLabel value="*" style="color : red;" />
				<h:outputLabel value="First Name " />
				<h:outputLabel value=" : " />
				<p:inputText value="#{registerAdminBean.employee.firstName}" />

				<h:outputLabel value="*" style="color : red;" />
				<h:outputLabel value="Last Name " />
				<h:outputLabel value=" : " />
				<p:inputText value="#{registerAdminBean.employee.lastName}" />

				<h:outputLabel value="*" style="color : red;" />
				<h:outputLabel value="Contact Number " />
				<h:outputLabel value=" : " />
				<p:inputMask mask="(999)999 9999"
					value="#{registerAdminBean.employee.telephone}" />

				<h:outputLabel value="*" style="color : red;" />
				<h:outputLabel value="Email " />
				<h:outputLabel value=" : " />
				<p:inputText value="#{registerAdminBean.employee.email}" />

				<h:inputHidden />
				<h:outputLabel value="Date of Birth " />
				<h:outputLabel value=" : " />
				<p:calendar value="#{registerAdminBean.employee.dateOfBirth}" />

				<h:inputHidden />
				<h:outputLabel value="Location " />
				<h:outputLabel value=" : " />
				<p:inputText value="#{registerAdminBean.employee.location}" />

				<h:outputLabel value="*" style="color : red;" />
				<h:outputLabel value="Password" />
				<h:outputLabel value=" : " />
				<p:password value="#{registerAdminBean.wamUser.password}"
					redisplay="true" />

				<h:outputLabel value="*" style="color : red;" />
				<h:outputLabel value="Confirm Password" />
				<h:outputLabel value=" : " />
				<p:password value="#{registerAdminBean.reenteredPassword}"
					strongLabel="false" />

				<h:inputHidden />
				<h:inputHidden />
				<h:inputHidden />
				<h:inputHidden />
				<h:inputHidden />
				<h:inputHidden />
				<h:inputHidden />
			</h:panelGrid>
			<h:panelGrid columns="8" style="width: 100%; border-top: 1px solid #d9d9d9;" rendered="#{not registerAdminBean.REGISTERED}">
				<h:panelGroup>
					<p:commandButton value="Register"
						action="#{registerAdminBean.saveAdmin}" ajax="false" />
					<p:commandButton value="Reset" action="registeradmin" />
				</h:panelGroup>
			</h:panelGrid>
			
			<h:panelGrid style="width: 100%; text-align: center; margin: 30px 0" rendered="#{registerAdminBean.REGISTERED}">
				<h:panelGroup>
					<p:commandButton value="Login to WAM" action="login" />					
				</h:panelGroup>
			</h:panelGrid>
		</h:form>
	</ui:define>
</ui:composition>

